/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package estatisticadescritiva;

import java.util.ArrayList;

/**
 *
 * @author Bush
 */
public class DesvioPadrao extends AbstractEstatistica {

    @Override
    public double calcula(ArrayList<Double> numeros) {
        double p1 = 1 / Double.valueOf(numeros.size() - 1);
            double p2 = getSomaDosElementosAoQuadrado(numeros) - (Math.pow(getSomaDosElementos(numeros), 2)
                    / Double.valueOf(numeros.size()));
            return Math.sqrt(p1 * p2);
    }
    
}
